if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
    pkg_check_modules(gtest_main QUIET IMPORTED_TARGET gtest_main)
    pkg_check_modules(gmock_main QUIET IMPORTED_TARGET gmock_main)
    set(packages PkgConfig::gtest_main
        PkgConfig::gmock_main)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
    # TODO
    warning("gtest_main not found, please install gtest_main")
else()
    message(FATAL_ERROR "Unsupported platform: ${CMAKE_SYSTEM_NAME}")
endif()

if (gtest_main_FOUND AND gmock_main_FOUND)
    build_all_target(${packages})
else()
    get_filename_component(CURRENT_DIR_NAME "${CMAKE_CURRENT_SOURCE_DIR}" NAME)
    message(STATUS "${packages} not found! Skipping ${CURRENT_DIR_NAME}")
endif()
